#include <gmlib/sm2/internal/sm2p256v1.h>
#include <stdexcept>
#include <cstring>

using namespace sm2::internal;

void test_sm2_fn_sqr()
{
    sm2_fn_t    a, c;
    std::uint8_t c_data[32];

    static std::uint8_t a0[32] = {0xdc,0x1c,0xf4,0x68,0x14,0xee,0x3f,0x7e,0x1b,0xd5,0x1c,0x4d,0xe7,0x9d,0x7b,0x6d,0xec,0xb8,0xb7,0x22,0xc4,0x4a,0xf5,0x6c,0xe1,0x44,0xa5,0x62,0x1a,0xd9,0x64,0x5d};
    static std::uint8_t c0[32] = {0x69,0xd7,0x2d,0x40,0x5c,0x17,0xc7,0x96,0xe9,0x52,0x98,0x1c,0x98,0xda,0x99,0xcf,0xec,0xd0,0x05,0x5c,0xb9,0xb9,0x98,0x72,0xb5,0x45,0xd1,0x90,0x16,0x37,0x70,0x3b};
    sm2_fn_from_bytes(a, a0);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c0, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a1[32] = {0xfa,0x1e,0xe8,0x54,0x76,0x9e,0xf4,0x7d,0x82,0x21,0x4a,0x8b,0xea,0x03,0xa3,0x7f,0x39,0x8b,0xab,0x13,0x56,0x7a,0xc8,0x1c,0xfd,0x5a,0x01,0x58,0xd7,0x99,0xb1,0xbb};
    static std::uint8_t c1[32] = {0x62,0x17,0x61,0x38,0x2a,0xaa,0x26,0x91,0x9f,0x58,0xf7,0x20,0xef,0xa9,0x8c,0x34,0x94,0xf4,0xb8,0x20,0x7c,0x01,0xbb,0x57,0x96,0x8b,0xe6,0x19,0xb1,0xa0,0x4d,0xa2};
    sm2_fn_from_bytes(a, a1);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c1, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a2[32] = {0x91,0xf8,0x11,0x41,0x15,0x23,0x4d,0xb9,0xf6,0x6e,0x19,0x89,0x45,0xde,0x95,0x1e,0x39,0xcb,0x41,0x8a,0x84,0xbe,0xfc,0x60,0xf2,0xc0,0xb3,0xb8,0xbc,0xfa,0x38,0x42};
    static std::uint8_t c2[32] = {0x21,0xa6,0x61,0x4c,0xe5,0x59,0x62,0x25,0x04,0x3b,0xf7,0xa0,0xc6,0x99,0x70,0xc1,0x13,0x92,0x17,0xa6,0xa1,0x5c,0x0f,0xe0,0x7c,0xa1,0xac,0x18,0xf2,0x83,0xa3,0xae};
    sm2_fn_from_bytes(a, a2);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c2, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a3[32] = {0x0a,0x5a,0x58,0xa9,0xb5,0x0a,0x08,0xb4,0x41,0x29,0x50,0x92,0x59,0x62,0x3d,0xe9,0xcd,0x84,0x7f,0x82,0x56,0x93,0x99,0xfe,0x5c,0x58,0xd4,0xa9,0x3e,0x98,0xc7,0xe7};
    static std::uint8_t c3[32] = {0xe5,0xa6,0xcb,0xd3,0x0f,0x88,0xa5,0xed,0x11,0x95,0xf5,0x24,0xd2,0x9d,0xa7,0x34,0xb0,0x21,0xc5,0x7c,0x72,0x77,0xf8,0xff,0xd3,0xc1,0x2b,0x8f,0x09,0x06,0x65,0x1f};
    sm2_fn_from_bytes(a, a3);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c3, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a4[32] = {0x2b,0x5b,0xd5,0x99,0x72,0x67,0xa3,0xb8,0x35,0xa2,0x45,0xf8,0xde,0xcd,0x37,0x3a,0x26,0xa5,0xa9,0x00,0x28,0x4c,0x4c,0xc0,0xa0,0x7e,0x4a,0x20,0xc6,0xe4,0x63,0x39};
    static std::uint8_t c4[32] = {0xed,0x8e,0x56,0x28,0xf7,0xd6,0xea,0x81,0x85,0x85,0x03,0x97,0xec,0x14,0xbb,0x49,0x0c,0xa5,0x05,0xeb,0x8c,0xd6,0xcc,0xe6,0x7d,0xb5,0xa4,0x56,0x75,0x04,0x3d,0xf3};
    sm2_fn_from_bytes(a, a4);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c4, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a5[32] = {0xc0,0x57,0xa7,0x8a,0x13,0xc4,0x47,0xa3,0x0b,0xd3,0x7a,0xa8,0x63,0xfa,0x6e,0xc4,0x7e,0x06,0x5e,0x45,0xd3,0x84,0x40,0xe3,0x6b,0x0e,0x37,0x9b,0xd8,0xf1,0xfd,0xa8};
    static std::uint8_t c5[32] = {0xb0,0x16,0xcd,0x06,0x57,0x8b,0xb4,0x30,0x04,0x36,0xbd,0xce,0x2c,0x4a,0xf6,0x50,0xbb,0x8f,0x95,0x7f,0x1b,0x7d,0xe2,0xcb,0x3f,0xb8,0xa0,0x02,0x63,0x0d,0x64,0x50};
    sm2_fn_from_bytes(a, a5);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c5, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a6[32] = {0xed,0xa6,0x8b,0xe6,0x89,0x05,0xa8,0x14,0x15,0xd1,0xf7,0xc8,0xa1,0x6d,0x8f,0xaf,0x79,0x43,0x98,0xdc,0xa2,0x38,0xfd,0xbc,0xc9,0x73,0xcb,0xf2,0xbf,0xf3,0x18,0x79};
    static std::uint8_t c6[32] = {0x40,0xc4,0xee,0x67,0xbb,0x6c,0xb8,0xf6,0xf8,0x95,0xe0,0xa9,0xc3,0x33,0xd4,0x1e,0x2f,0x7e,0x4e,0x18,0x52,0x10,0x29,0x5d,0xac,0x6e,0x93,0x64,0x84,0x74,0x3f,0xc1};
    sm2_fn_from_bytes(a, a6);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c6, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a7[32] = {0x26,0xd1,0x77,0x97,0x12,0xca,0xd4,0xe0,0xd4,0xe3,0xe6,0x59,0x3a,0x01,0xbe,0x59,0xaa,0x37,0x21,0xfb,0x84,0xad,0xaa,0x11,0x71,0x02,0x0b,0x50,0x05,0x5a,0x96,0xeb};
    static std::uint8_t c7[32] = {0x1a,0xa4,0x9a,0x4b,0x60,0x91,0x3a,0x87,0x16,0xb3,0x20,0x61,0xf4,0x7d,0x95,0x9a,0xfb,0xb9,0x0e,0x82,0x97,0x57,0xdd,0x41,0xfc,0x02,0xfb,0x4c,0x9f,0xb8,0x79,0xfc};
    sm2_fn_from_bytes(a, a7);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c7, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a8[32] = {0x98,0x11,0x95,0xcf,0x46,0x26,0x51,0x90,0xa7,0xaf,0x16,0x26,0x9b,0xa4,0x70,0xdb,0x4b,0xa4,0x01,0x0e,0x41,0x0b,0x84,0x48,0xb0,0x33,0xe1,0x6b,0xa3,0x46,0xcb,0x65};
    static std::uint8_t c8[32] = {0x2e,0x1b,0x7a,0xae,0xa4,0x20,0xd6,0xca,0x54,0xd2,0xb5,0x39,0xb4,0x93,0x90,0x5d,0xc0,0x78,0xf0,0xaf,0x5f,0xdd,0x5e,0x83,0x06,0x6d,0x6d,0xcc,0xb3,0x0f,0x17,0x9d};
    sm2_fn_from_bytes(a, a8);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c8, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a9[32] = {0xf6,0xc6,0xc6,0xea,0x92,0x47,0xf5,0x91,0x0e,0xf4,0xfe,0x50,0x20,0x27,0xb0,0x45,0x5b,0xb2,0x67,0xbb,0x3f,0xb8,0x9c,0x9d,0x5d,0x6a,0x2c,0xfc,0xd8,0x61,0x3b,0x64};
    static std::uint8_t c9[32] = {0xcc,0x23,0x2f,0xbf,0xa4,0x88,0x07,0x30,0x71,0x5d,0x89,0x4d,0xa6,0x68,0xa9,0xe6,0x3b,0x7b,0xa3,0x19,0x96,0xbd,0x19,0x38,0x86,0x40,0xd3,0xa3,0x5a,0x30,0xd1,0xbe};
    sm2_fn_from_bytes(a, a9);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c9, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a10[32] = {0x5d,0xec,0x98,0xbb,0xcc,0x39,0xc5,0x47,0x19,0x3d,0x94,0xd3,0x37,0xf9,0x28,0x2e,0x4d,0x72,0x9b,0x02,0x86,0x5c,0x60,0xab,0x0d,0x20,0x60,0x8a,0xfc,0x95,0x0d,0x12};
    static std::uint8_t c10[32] = {0x74,0xb5,0x80,0x94,0xbc,0x9f,0xcb,0xd9,0x6a,0x55,0xaf,0xf9,0x56,0x89,0xd1,0xbb,0x9e,0x30,0xdf,0x05,0x11,0xdc,0x5b,0xfd,0xa8,0xc6,0x8a,0x5e,0xf2,0x67,0x86,0xd2};
    sm2_fn_from_bytes(a, a10);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c10, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a11[32] = {0x38,0x13,0x0b,0x32,0x61,0x46,0xa5,0x54,0x08,0xba,0xdc,0x47,0xef,0x3d,0xc3,0x21,0xed,0xb7,0x61,0xd7,0xe4,0xe6,0xbd,0x9d,0xa8,0xf0,0xd4,0xff,0x00,0xe3,0xda,0x44};
    static std::uint8_t c11[32] = {0x9e,0xb3,0xbe,0x87,0x25,0xfb,0xd8,0x7c,0x4b,0x28,0x8b,0x64,0xf8,0x9e,0x43,0x6f,0xd3,0xa3,0x49,0x00,0x49,0x08,0xbb,0xf9,0x7a,0x5b,0x3c,0x3d,0x75,0xb6,0x23,0x24};
    sm2_fn_from_bytes(a, a11);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c11, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a12[32] = {0x72,0x7d,0xe2,0xdd,0x30,0xdd,0x03,0x98,0xba,0x5b,0x5d,0xea,0x5e,0x70,0xcd,0x83,0xc0,0x2f,0x2d,0x58,0xfb,0x8b,0x0e,0xbd,0x52,0x92,0x8c,0x44,0x28,0xad,0xa9,0x61};
    static std::uint8_t c12[32] = {0xf0,0x3d,0xd7,0x42,0x94,0x55,0x57,0xd3,0x57,0xa2,0xa4,0xb4,0x58,0x88,0x62,0x39,0x60,0x37,0xe7,0xba,0x6e,0xe3,0x3e,0x0a,0xb6,0xf8,0x25,0x35,0x7d,0x79,0x39,0x18};
    sm2_fn_from_bytes(a, a12);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c12, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a13[32] = {0xfe,0x98,0x38,0xc9,0x3a,0x96,0xe4,0x7f,0xbc,0xb6,0x2a,0x85,0x41,0x99,0xf6,0xa5,0x55,0xe9,0xcb,0xbb,0xba,0xa9,0x00,0x13,0x67,0xfe,0x35,0x27,0x24,0x7f,0xf8,0x24};
    static std::uint8_t c13[32] = {0xa7,0x1e,0x86,0x15,0xfe,0x8e,0x12,0x12,0x58,0xfb,0x21,0xeb,0x97,0x70,0x50,0x9b,0x9d,0x63,0x0d,0x51,0x4f,0xa0,0x24,0xde,0x09,0x58,0x66,0x2d,0x10,0xbd,0x8d,0xa6};
    sm2_fn_from_bytes(a, a13);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c13, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a14[32] = {0x65,0x4c,0x6b,0x81,0xbe,0xd0,0x77,0xf4,0x78,0xb7,0xc3,0x31,0x3a,0x0f,0x51,0x54,0x84,0xc2,0xa0,0x91,0x44,0xa1,0xf9,0x2c,0x41,0xc0,0x19,0xc9,0xfa,0x68,0xb0,0xe3};
    static std::uint8_t c14[32] = {0x3a,0x98,0xb7,0x72,0xe6,0x26,0xcb,0x57,0x79,0x94,0x9a,0x2b,0xb1,0xc9,0x29,0xac,0x8c,0x7e,0x36,0x33,0x95,0x87,0x18,0xfe,0xfe,0x51,0x94,0x3b,0x54,0xed,0x84,0x80};
    sm2_fn_from_bytes(a, a14);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c14, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a15[32] = {0x9b,0x58,0xe8,0xa7,0x34,0x31,0x10,0x3c,0x21,0x8f,0x02,0x3d,0x67,0xcc,0xe2,0xc2,0x27,0x4b,0xad,0x0e,0xc9,0xe1,0x22,0x13,0x4e,0x1a,0xd5,0xae,0x25,0x14,0xb1,0x08};
    static std::uint8_t c15[32] = {0x39,0x72,0xd1,0x2d,0x20,0xa7,0x2f,0x97,0xa2,0xd0,0x7f,0x98,0x62,0xb7,0x02,0xf4,0x7d,0x5a,0x5b,0x64,0xc4,0xf1,0x6f,0xe3,0xa0,0x2d,0xde,0xf6,0xef,0x92,0x56,0x6c};
    sm2_fn_from_bytes(a, a15);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c15, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a16[32] = {0xa8,0x3e,0x12,0x76,0xc5,0xe1,0xb6,0x81,0x8a,0xc2,0xfd,0x62,0x71,0x5b,0x93,0x4a,0xcb,0x4a,0xc6,0x16,0x91,0x4b,0x8f,0xc6,0xd6,0x2c,0x65,0x04,0x2d,0x03,0xc6,0xcd};
    static std::uint8_t c16[32] = {0x16,0x30,0x58,0x02,0xd6,0xd9,0x31,0x6a,0x62,0x5f,0x0f,0xdd,0x61,0x0c,0x6e,0xc6,0xed,0x9c,0x45,0xcd,0xf6,0x95,0x8c,0x41,0xcb,0x13,0x9b,0x8f,0xc0,0x0e,0x5c,0x11};
    sm2_fn_from_bytes(a, a16);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c16, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a17[32] = {0xa1,0x15,0x1d,0x6a,0x74,0x51,0x88,0x00,0xbd,0x3b,0x85,0xbd,0x57,0xc6,0x11,0x5c,0xd3,0x65,0x89,0x8b,0xa7,0xd1,0x08,0xc7,0xbb,0x84,0x7d,0x0f,0xea,0xfd,0xc8,0x42};
    static std::uint8_t c17[32] = {0x8f,0xca,0x4a,0x34,0x36,0xb9,0x44,0x9e,0xff,0x4c,0x8f,0xe8,0x17,0x38,0xaf,0xb0,0x62,0x4c,0x91,0xe3,0x8f,0xe5,0x62,0xbf,0xe6,0x2e,0x24,0x49,0xbe,0x26,0x98,0x1a};
    sm2_fn_from_bytes(a, a17);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c17, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a18[32] = {0x83,0xd4,0x30,0xfd,0x81,0x2d,0xda,0xf3,0xc4,0x30,0xf5,0x87,0x6a,0xdf,0x6c,0x05,0xed,0x36,0x48,0x89,0x2c,0x53,0x24,0xe5,0xba,0xcd,0x15,0x08,0xda,0x50,0x73,0x93};
    static std::uint8_t c18[32] = {0x6d,0xbd,0xb9,0xa3,0x82,0xb3,0x41,0x0a,0x48,0x57,0x94,0x67,0x4d,0x28,0x1a,0x63,0xf3,0x79,0x73,0x31,0xc3,0x88,0xd6,0x26,0xbf,0x36,0x1e,0xe5,0x2c,0x54,0x8e,0x43};
    sm2_fn_from_bytes(a, a18);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c18, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a19[32] = {0xd1,0x94,0xd9,0x98,0xab,0xda,0xc6,0xd5,0x4a,0x35,0x17,0x22,0xa9,0x5d,0xab,0x12,0xfe,0x30,0xcb,0xda,0x4b,0xd8,0x5d,0x75,0xc4,0x0d,0xd6,0x43,0xbc,0xa0,0xe9,0xca};
    static std::uint8_t c19[32] = {0x50,0x39,0x2b,0x9b,0xa7,0x80,0x3b,0x56,0xde,0x73,0xb3,0xa6,0x39,0x02,0xa8,0x8b,0x73,0x13,0xe9,0x5f,0x10,0xb2,0x4c,0x03,0x26,0x74,0xa5,0x55,0xf0,0x0f,0x05,0x9c};
    sm2_fn_from_bytes(a, a19);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c19, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a20[32] = {0x75,0x45,0xae,0xf8,0xca,0x20,0x23,0x7d,0x32,0xc6,0xe8,0x06,0x51,0xa9,0xe6,0x81,0xbc,0x88,0xf6,0x3c,0x42,0xaa,0x4c,0x11,0x95,0x72,0xdc,0xb1,0xb1,0x7b,0x5e,0xa1};
    static std::uint8_t c20[32] = {0x63,0xfa,0xd0,0xbd,0xa9,0x72,0xa2,0xec,0x91,0xd4,0xc7,0x4f,0x73,0xc9,0xf8,0x00,0x0f,0x5d,0x1b,0x98,0x33,0xe3,0x8b,0x15,0xda,0x62,0xb3,0x3a,0x28,0xda,0x1a,0x3d};
    sm2_fn_from_bytes(a, a20);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c20, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a21[32] = {0x41,0xe3,0xd3,0x58,0xce,0x05,0x1b,0x70,0x69,0x7e,0x9f,0x24,0x6f,0x22,0xb8,0xf5,0xe4,0xf3,0x4d,0x30,0x36,0x1c,0x41,0x00,0xdf,0x40,0xcd,0x4d,0x78,0x6e,0xf1,0xb5};
    static std::uint8_t c21[32] = {0x5e,0x75,0x53,0xc2,0x7e,0x82,0xaf,0x4d,0x80,0x18,0xd0,0x0a,0xdb,0xa3,0x1d,0xd4,0x11,0x9b,0xad,0x15,0x56,0xba,0xef,0x93,0xba,0x4e,0x83,0x1b,0x21,0x8d,0xad,0xfa};
    sm2_fn_from_bytes(a, a21);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c21, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a22[32] = {0x9e,0x3f,0x8e,0x7b,0xc7,0xe3,0x4a,0x9f,0x2b,0xfd,0xb0,0x59,0x89,0xe3,0x62,0xf2,0xc1,0x14,0x08,0x25,0x53,0x6e,0x75,0xfa,0x1f,0xad,0xad,0xfc,0xfe,0xcd,0xb7,0x00};
    static std::uint8_t c22[32] = {0xfd,0xe8,0x4e,0x13,0xf7,0xbb,0x47,0x3a,0x5f,0x62,0xf5,0xca,0xb3,0xa1,0xd7,0x73,0xe5,0x46,0x44,0xd7,0x82,0xbe,0x9d,0xc9,0xae,0x1f,0xec,0x7e,0xb4,0xdb,0xea,0xae};
    sm2_fn_from_bytes(a, a22);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c22, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a23[32] = {0x37,0x9f,0x9b,0xca,0xbd,0xe6,0x9d,0x79,0x65,0x7b,0x7b,0x8c,0xaa,0x3e,0x34,0x9b,0xf9,0x77,0xbb,0x46,0x68,0x00,0x8c,0x21,0x19,0xc1,0xcc,0x6e,0xc8,0xe3,0x23,0x69};
    static std::uint8_t c23[32] = {0x1f,0x33,0x86,0x90,0x63,0x73,0x99,0xe5,0x38,0x32,0x10,0x0a,0x66,0x81,0x2a,0x1d,0xd8,0x10,0x63,0x59,0xae,0x90,0xc9,0x7e,0x6d,0x2e,0x18,0xb7,0x87,0x61,0x09,0x86};
    sm2_fn_from_bytes(a, a23);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c23, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a24[32] = {0x48,0x21,0xa1,0xdb,0x88,0x63,0x99,0xfa,0x5c,0xa0,0x33,0x10,0x26,0x90,0xd5,0xaa,0x04,0xe4,0xb5,0x29,0xd7,0x33,0x4b,0xcd,0x7a,0x06,0xa7,0xa2,0xd6,0x90,0x3c,0xce};
    static std::uint8_t c24[32] = {0xbf,0x00,0xa0,0xaf,0xee,0xad,0xee,0x89,0x02,0x0a,0xa3,0x59,0x9a,0x4e,0x0d,0x7f,0x08,0xd3,0xef,0xc1,0x93,0x49,0x6e,0x4e,0x25,0xdc,0x44,0x76,0x2f,0x57,0x0b,0x92};
    sm2_fn_from_bytes(a, a24);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c24, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a25[32] = {0x18,0xd0,0x80,0x3c,0xba,0xcd,0x48,0xe3,0x9f,0xdd,0x4a,0x59,0xdc,0xe6,0xe3,0x18,0x9c,0xb1,0x70,0x24,0x32,0x9e,0x0d,0x18,0xff,0xe5,0xea,0x32,0x1a,0x22,0x38,0x15};
    static std::uint8_t c25[32] = {0xb1,0x7a,0x54,0xde,0x15,0x8a,0x41,0xbc,0xae,0x1d,0x1a,0xa4,0x96,0x4b,0xa3,0xdf,0x77,0xc3,0x6d,0x19,0x60,0xe3,0xb0,0x3e,0x47,0x7f,0x53,0x2e,0xc9,0x01,0x28,0x8f};
    sm2_fn_from_bytes(a, a25);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c25, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a26[32] = {0xb6,0x63,0xc8,0x6d,0x4c,0x33,0x66,0x28,0xeb,0xcd,0xd6,0xfb,0xfc,0x7d,0xa4,0x7d,0x44,0xf5,0x9b,0xec,0xe1,0xc0,0xec,0x2e,0x31,0xdd,0x5b,0xe1,0x69,0xd1,0x8d,0x70};
    static std::uint8_t c26[32] = {0xdd,0x48,0xbd,0xe7,0x65,0xdd,0x0a,0xfb,0x8c,0x8e,0x23,0x98,0x34,0xd6,0xe9,0xe1,0x74,0x58,0x37,0x76,0xbc,0x4c,0xa7,0x78,0x7b,0x07,0x5a,0x24,0xd7,0xa2,0x54,0x5e};
    sm2_fn_from_bytes(a, a26);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c26, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a27[32] = {0x9c,0x69,0x01,0x2c,0xcd,0xf7,0x6e,0x50,0x82,0x89,0xb1,0xd8,0x83,0x3d,0xe0,0x77,0xd4,0xb3,0xe0,0x8e,0xe9,0xfc,0xdd,0x51,0x8b,0xa0,0xe9,0xe8,0xbd,0xfd,0x62,0x0a};
    static std::uint8_t c27[32] = {0xee,0xe8,0xc0,0xd1,0x14,0x81,0x4d,0x45,0x22,0x67,0xe3,0xf8,0x99,0xd9,0xf7,0x75,0x12,0xe7,0x0a,0x65,0x44,0x63,0x93,0x46,0xd1,0xe9,0x7d,0xf6,0x19,0x29,0x77,0x1e};
    sm2_fn_from_bytes(a, a27);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c27, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a28[32] = {0x34,0x5d,0xff,0x20,0x11,0xd7,0x28,0xa8,0x64,0x7f,0x43,0xcd,0x57,0x68,0xc8,0x1f,0xac,0xf4,0xa9,0x10,0x53,0xc1,0xe9,0x75,0x73,0xf2,0x73,0xcf,0xfd,0x15,0x53,0x8e};
    static std::uint8_t c28[32] = {0x4d,0x97,0x02,0x7b,0x3d,0x78,0xe8,0xdf,0x63,0x2d,0x75,0x0b,0xd9,0x30,0x15,0xad,0x80,0x9c,0x88,0x16,0x8a,0x0e,0xe2,0x16,0xb5,0x4e,0x4a,0x9e,0x1f,0x06,0xf2,0x09};
    sm2_fn_from_bytes(a, a28);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c28, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a29[32] = {0xef,0x78,0xcf,0xba,0x41,0x27,0x68,0x46,0x52,0x06,0x64,0x48,0x28,0xbb,0x56,0x30,0x49,0xd4,0xd1,0x61,0x6c,0x25,0x14,0x5a,0xb3,0x76,0x9e,0xdf,0x41,0xed,0x7b,0x53};
    static std::uint8_t c29[32] = {0xb4,0x54,0xa0,0x39,0xa1,0xeb,0xb0,0x61,0xd1,0xba,0xc1,0x36,0xad,0xa2,0x36,0x22,0x21,0x7d,0xfd,0xa4,0xdd,0xe6,0xb1,0x0a,0x0c,0x71,0x1d,0xa2,0x80,0xd9,0xdb,0x72};
    sm2_fn_from_bytes(a, a29);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c29, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a30[32] = {0x87,0xd6,0xa5,0x77,0xec,0x5c,0x0d,0xb9,0xa8,0x55,0x3f,0xd9,0x8a,0x07,0x4c,0xf8,0x50,0x75,0x11,0x62,0xaa,0x21,0x89,0x88,0xb4,0x64,0x7a,0x55,0x6b,0xad,0x1a,0x70};
    static std::uint8_t c30[32] = {0x82,0x15,0x2e,0x78,0x83,0x11,0x80,0xa6,0x94,0x68,0x13,0xdd,0xfd,0x78,0x1c,0xb2,0x5d,0xc9,0x94,0x6e,0x44,0x7b,0xa2,0xb9,0x5d,0x15,0xc0,0x13,0x94,0xb8,0x85,0x42};
    sm2_fn_from_bytes(a, a30);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c30, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a31[32] = {0x9d,0x92,0xf6,0xcf,0x93,0x25,0x03,0x0b,0x9f,0xe3,0x21,0x78,0x57,0xe1,0x48,0x84,0x2f,0x84,0x94,0x32,0x91,0xd7,0xee,0x68,0x1f,0x5a,0x11,0xe3,0xfb,0x0a,0x4e,0xcc};
    static std::uint8_t c31[32] = {0x67,0xe6,0x89,0x07,0xa9,0x56,0x8e,0x4f,0x52,0x71,0x76,0xb0,0x19,0x15,0xcf,0x2f,0x8a,0xf9,0xad,0x41,0x93,0x49,0x6a,0x32,0xb6,0x79,0x46,0x93,0x38,0x4f,0x26,0x15};
    sm2_fn_from_bytes(a, a31);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c31, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a32[32] = {0xa2,0x0b,0xaf,0xe2,0x36,0xaf,0xf4,0x77,0x04,0x7b,0xbf,0xa0,0xec,0x14,0x74,0x22,0x5d,0xc2,0x78,0x2b,0xa7,0xf1,0x20,0x17,0xd0,0x5e,0x8e,0x46,0xd1,0x2e,0xc9,0x96};
    static std::uint8_t c32[32] = {0x73,0x31,0x74,0xd0,0x63,0x77,0x17,0x02,0x0c,0x41,0xd8,0x17,0x7a,0xa7,0xb0,0xa1,0x70,0x68,0xd4,0xd8,0x86,0xa8,0x6c,0xd8,0x54,0x36,0x56,0xd5,0x35,0x70,0x67,0x72};
    sm2_fn_from_bytes(a, a32);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c32, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a33[32] = {0xbd,0x37,0x7c,0x9c,0x59,0x22,0x71,0xf0,0x30,0x22,0x2f,0x7f,0xc7,0xda,0x97,0x33,0x71,0x3a,0xc0,0xae,0xa1,0x17,0xe0,0x2a,0x01,0x36,0xc3,0x17,0xd8,0xab,0xdd,0xaf};
    static std::uint8_t c33[32] = {0xb5,0xf1,0x5f,0x5c,0x7b,0x7e,0x92,0xe6,0x4b,0xbe,0x1e,0x1c,0x03,0x8a,0x71,0xd5,0xc1,0x45,0xdd,0x86,0x12,0x76,0x42,0x49,0x2e,0x2e,0x1f,0x69,0xb5,0x73,0x40,0xb7};
    sm2_fn_from_bytes(a, a33);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c33, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a34[32] = {0xa4,0x10,0xa8,0x7a,0x82,0x1a,0x81,0x84,0x08,0xbf,0x71,0x9c,0x22,0x19,0x09,0xcb,0xd5,0xd1,0x75,0x81,0x73,0xb3,0xa4,0x88,0x92,0xd0,0xc3,0x11,0x96,0xf0,0x96,0xae};
    static std::uint8_t c34[32] = {0x8e,0xfb,0x6b,0x2f,0xa2,0xc2,0xde,0x27,0xa6,0x00,0x54,0xea,0x47,0x06,0x4d,0xa6,0x33,0xc6,0x81,0xc5,0x14,0xdd,0xd1,0x92,0x2c,0x96,0x22,0x71,0x90,0x7c,0x06,0x32};
    sm2_fn_from_bytes(a, a34);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c34, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a35[32] = {0x70,0xf6,0x40,0x02,0x73,0xba,0xd8,0xe3,0x5a,0x5f,0x2a,0x5b,0x4e,0x41,0xdb,0xc5,0x02,0x41,0x07,0x5e,0xa8,0xfb,0xb3,0x24,0xf3,0xd8,0x15,0xcd,0xe0,0x7b,0xaf,0xad};
    static std::uint8_t c35[32] = {0xb2,0xe5,0xfc,0xdd,0x85,0x65,0x52,0xb9,0x47,0x95,0xe0,0xad,0x18,0x8b,0x5f,0xb9,0xe3,0x64,0x3d,0x37,0xcf,0x0c,0xcd,0xe7,0x38,0xd3,0x30,0x64,0xd6,0xaa,0x3d,0xa7};
    sm2_fn_from_bytes(a, a35);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c35, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a36[32] = {0x55,0x38,0x03,0x89,0xa5,0x07,0x63,0xd9,0x77,0x97,0x0a,0xb1,0x3f,0x4f,0x33,0x04,0x61,0x82,0x25,0x6e,0xaa,0x68,0x47,0x37,0x97,0x74,0x12,0x51,0xd7,0x9d,0xac,0xb2};
    static std::uint8_t c36[32] = {0x41,0xed,0x0c,0x46,0xb7,0xbe,0x53,0x47,0x4b,0xed,0xf4,0x9c,0x05,0x85,0xf6,0x52,0xb6,0x0d,0xa1,0x80,0x55,0x2a,0xb0,0x03,0xe8,0xf0,0xd8,0x0d,0x2c,0x5b,0xad,0xb8};
    sm2_fn_from_bytes(a, a36);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c36, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a37[32] = {0x69,0x83,0x0a,0x61,0x83,0x38,0xbf,0xe7,0xe1,0x78,0xba,0x0d,0x83,0x2a,0x57,0x3d,0x6f,0x71,0x94,0xc2,0x9f,0x0f,0xcf,0x02,0xc8,0xad,0xfe,0xf0,0xae,0xd9,0x37,0x81};
    static std::uint8_t c37[32] = {0x53,0x47,0x86,0x26,0x00,0x47,0x98,0x76,0x21,0x69,0x9d,0x92,0x38,0xd3,0xe4,0x1a,0xa6,0x07,0x90,0xab,0x00,0x97,0x40,0x76,0xd4,0x76,0x23,0x70,0xe7,0x40,0xe5,0xf5};
    sm2_fn_from_bytes(a, a37);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c37, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a38[32] = {0xf2,0x17,0xb3,0x88,0x46,0x20,0x8b,0x3d,0x1a,0x5b,0x31,0x59,0xf9,0x35,0x09,0xb3,0x8e,0xbd,0xd8,0xd8,0x88,0x89,0x39,0x3f,0x05,0x62,0x35,0x59,0x48,0x35,0x80,0xae};
    static std::uint8_t c38[32] = {0x74,0x15,0x85,0x70,0xac,0xf2,0x18,0x66,0xda,0x8c,0xf4,0xf7,0xae,0xc2,0xaf,0x71,0x18,0xf8,0x9b,0xcf,0x1b,0x99,0x95,0x18,0xb3,0xce,0xbe,0xe5,0x8f,0x0b,0xdd,0x1e};
    sm2_fn_from_bytes(a, a38);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c38, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a39[32] = {0x00,0x50,0x00,0x9e,0x0f,0x31,0x0f,0x58,0x93,0xf8,0xfc,0x2e,0x32,0x5b,0xb7,0xec,0x97,0xad,0xa1,0x63,0xe4,0x42,0xa7,0xb2,0x50,0xc2,0x62,0x55,0xde,0x71,0x8b,0xee};
    static std::uint8_t c39[32] = {0xe4,0x02,0xa4,0x54,0x03,0xe6,0xec,0x83,0xc6,0xef,0x43,0xfa,0x4a,0xc3,0xa9,0xa8,0x25,0xe7,0xc5,0xf1,0x4a,0x57,0x67,0xbd,0x72,0xe2,0x26,0xda,0xf3,0xde,0xc2,0x48};
    sm2_fn_from_bytes(a, a39);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c39, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a40[32] = {0x52,0x78,0x0f,0xb7,0xc6,0x13,0x30,0x61,0x58,0x82,0xfa,0x62,0xbb,0x80,0xa5,0xf6,0xbc,0x90,0xaf,0x8f,0xf7,0x88,0xb1,0xc4,0x28,0x98,0x80,0x98,0x78,0xd4,0x7a,0x9b};
    static std::uint8_t c40[32] = {0x96,0xab,0xf8,0x88,0x11,0xdf,0xec,0x13,0x48,0x61,0x97,0x41,0x32,0x60,0x34,0x99,0x86,0xcb,0x14,0x77,0xfb,0xc8,0xaa,0xb3,0x6f,0x16,0x3c,0x81,0xd0,0x2b,0x5c,0x2d};
    sm2_fn_from_bytes(a, a40);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c40, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a41[32] = {0xba,0xb5,0xed,0xc7,0x83,0xa2,0x16,0xf4,0x0b,0xa4,0x4f,0x6c,0x75,0x93,0xa9,0x18,0xc6,0x22,0xb4,0x99,0xd9,0x76,0xe5,0xa4,0xbf,0x44,0xdb,0xf9,0xba,0xb4,0x8d,0x94};
    static std::uint8_t c41[32] = {0xe7,0x5b,0xa8,0x04,0x65,0x5e,0x2f,0x2b,0xe8,0xca,0x26,0xe8,0xbf,0x7e,0x45,0x9e,0x7a,0x75,0x60,0xbb,0x7e,0x29,0x36,0xd3,0x9a,0x2a,0xec,0xbc,0x35,0xcf,0x55,0xf7};
    sm2_fn_from_bytes(a, a41);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c41, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a42[32] = {0x09,0xfa,0xfd,0x4b,0xa7,0x6d,0xbb,0x16,0xa2,0xf0,0x2d,0x03,0x30,0xed,0x17,0x1d,0x83,0x42,0x7d,0x1e,0xb9,0x5a,0xcf,0x65,0x17,0x5e,0x85,0x78,0xec,0xb1,0xe5,0xc1};
    static std::uint8_t c42[32] = {0x90,0x7d,0x7c,0x76,0xa3,0xc3,0x8c,0xd6,0xf8,0x81,0xf2,0x17,0xe5,0x9f,0x94,0x2c,0xb8,0xa4,0x1e,0xad,0x01,0x87,0xdd,0x3f,0x14,0xcc,0xd9,0x8f,0xf9,0xf1,0xa5,0x57};
    sm2_fn_from_bytes(a, a42);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c42, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a43[32] = {0xca,0x14,0x86,0xfc,0x2b,0x54,0xb2,0x35,0x30,0x9b,0xbf,0xac,0x63,0x26,0xed,0x03,0x51,0xdb,0xf7,0x37,0x43,0x19,0xd4,0x5d,0x94,0x24,0xa5,0xd9,0xa3,0x75,0x38,0xf9};
    static std::uint8_t c43[32] = {0x5f,0xf1,0xe5,0x00,0x2c,0xb3,0x09,0x61,0x71,0xbb,0x29,0x29,0x72,0xaf,0x26,0x2e,0x1a,0x1d,0xe4,0xb9,0x5c,0x1e,0x6d,0x18,0x02,0x91,0x9a,0x2b,0xe5,0x4f,0x9b,0x9a};
    sm2_fn_from_bytes(a, a43);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c43, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a44[32] = {0x47,0x00,0x0c,0xaf,0x0d,0x67,0x79,0xbc,0x77,0x37,0xd2,0x2d,0xf4,0xba,0x3d,0xb6,0xbc,0xa8,0xa6,0x6c,0x17,0x24,0x69,0x1d,0x06,0x79,0x1f,0x5e,0x7f,0x30,0xc3,0x7b};
    static std::uint8_t c44[32] = {0x8c,0x47,0x32,0xb8,0xa6,0x95,0xd8,0xbd,0xbd,0x32,0xc9,0x90,0x89,0xa9,0x7f,0xbe,0xd1,0x44,0xa4,0x67,0x00,0x07,0x9a,0xa7,0x8f,0x1d,0x07,0x57,0x45,0xd9,0x58,0x9b};
    sm2_fn_from_bytes(a, a44);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c44, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a45[32] = {0x90,0x25,0xa4,0xb4,0x02,0x30,0xee,0x60,0x4b,0xad,0x77,0x29,0x0a,0x69,0xbe,0x9b,0x1e,0x6e,0xff,0xb6,0xcd,0x6e,0xd2,0x53,0x33,0xc1,0x4f,0x05,0xa2,0xd2,0x70,0x3a};
    static std::uint8_t c45[32] = {0x0d,0xaf,0x7c,0x14,0xea,0xbe,0x3d,0x66,0x78,0x01,0x71,0x80,0x42,0xa9,0x1a,0x07,0x13,0xc9,0xf5,0x00,0x3d,0x15,0x53,0xbd,0x0d,0x11,0x71,0xf0,0xcf,0x70,0x52,0x91};
    sm2_fn_from_bytes(a, a45);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c45, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a46[32] = {0xef,0x71,0x16,0xf6,0x87,0xff,0xd6,0x91,0x50,0x05,0x4c,0x31,0x7b,0xf6,0xd0,0x98,0xcd,0xf0,0x64,0x87,0x6b,0x38,0xc4,0x13,0xbc,0xf6,0x5d,0xf4,0x4a,0x17,0xff,0xf2};
    static std::uint8_t c46[32] = {0x65,0xf5,0xf7,0xd5,0x4e,0x10,0x82,0xa6,0x41,0x3b,0xa6,0xcd,0x92,0x75,0x98,0x55,0xae,0x19,0x69,0xb4,0x5f,0x22,0xc4,0x99,0x3e,0xfd,0x00,0xd9,0xac,0x47,0x85,0xec};
    sm2_fn_from_bytes(a, a46);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c46, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a47[32] = {0x22,0x8c,0xff,0xa2,0x03,0xbf,0x85,0x10,0x5d,0x4a,0x89,0x5e,0x5e,0xf7,0x41,0xde,0x04,0xf9,0xab,0xf6,0x68,0x11,0x82,0xea,0x22,0x36,0x74,0x71,0x25,0xd4,0x81,0x32};
    static std::uint8_t c47[32] = {0xc3,0x8b,0xd4,0xb9,0x4a,0x2d,0xa5,0x97,0xa4,0x17,0x6e,0xd5,0xac,0xc0,0xb0,0xe6,0xb0,0x08,0x18,0xbb,0x40,0xa1,0xd7,0xed,0xb2,0x81,0x34,0xcf,0x48,0xae,0x78,0xb7};
    sm2_fn_from_bytes(a, a47);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c47, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a48[32] = {0xe8,0xb0,0x7a,0xeb,0x3b,0xf3,0x6a,0xd2,0xad,0xa3,0xca,0x88,0x63,0xd0,0xb6,0x85,0xbe,0x3d,0xbc,0x87,0xd5,0x83,0x49,0x0b,0x57,0xda,0x46,0x6f,0xc3,0x95,0xd1,0xbf};
    static std::uint8_t c48[32] = {0x12,0x9f,0xf9,0xd1,0x13,0xfa,0x0d,0xc3,0x07,0xb7,0xf7,0x49,0x5b,0x00,0x1b,0xc9,0x1e,0xcc,0x3b,0xff,0x4d,0xcd,0xf3,0xfd,0x46,0xad,0x5c,0x12,0x0f,0xc9,0xf1,0x3a};
    sm2_fn_from_bytes(a, a48);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c48, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a49[32] = {0x32,0x0d,0x1e,0x03,0x52,0x1a,0x2f,0xc5,0x7b,0xfb,0x38,0x77,0xe1,0x98,0x88,0xaf,0x31,0xe5,0xbb,0x53,0xae,0x95,0x41,0x05,0x9f,0x5c,0xff,0x8b,0xf3,0x9a,0x6b,0x20};
    static std::uint8_t c49[32] = {0x3b,0xda,0x14,0x10,0xad,0x96,0x7b,0xe6,0x5d,0x18,0xa3,0x4e,0x2b,0xa2,0x43,0x46,0xf0,0xfb,0x5f,0x99,0xb7,0x11,0xdd,0xed,0x5c,0xf6,0xd6,0x21,0x33,0x55,0xc4,0x00};
    sm2_fn_from_bytes(a, a49);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c49, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a50[32] = {0x1a,0xa7,0x10,0x82,0xa7,0x6f,0x14,0x5a,0x8e,0xb4,0x9b,0x4d,0x5e,0x65,0xa3,0x74,0x0b,0xc7,0x50,0xcc,0x45,0xf4,0x4c,0xef,0x0f,0x83,0x87,0xc3,0x2f,0x4f,0x4b,0xff};
    static std::uint8_t c50[32] = {0x95,0x49,0x30,0xa0,0x3a,0x6f,0x30,0xfc,0x3f,0xc7,0x1e,0x97,0xeb,0x79,0x44,0x8a,0x33,0xad,0xfa,0x5d,0xa9,0x3c,0x8d,0x75,0x0a,0x51,0x55,0x77,0x6c,0xfb,0xf4,0x30};
    sm2_fn_from_bytes(a, a50);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c50, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a51[32] = {0x18,0x6b,0xff,0xf5,0x35,0x37,0xb8,0x3d,0xbb,0x91,0x9e,0xf1,0x17,0x24,0x7b,0x57,0x2e,0x05,0x16,0x07,0x04,0xb8,0xe1,0x42,0xcb,0x75,0x45,0x69,0xd5,0x9e,0xab,0x57};
    static std::uint8_t c51[32] = {0x5f,0x7e,0x88,0x40,0x89,0xa7,0x6b,0x71,0x56,0xc2,0xca,0xe3,0xbe,0xea,0x6f,0xb8,0x31,0x87,0xf3,0x53,0xc0,0x2b,0x32,0x5f,0x5a,0x25,0x39,0x48,0x84,0x16,0x12,0x55};
    sm2_fn_from_bytes(a, a51);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c51, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a52[32] = {0x67,0xac,0xd6,0x6a,0xc5,0x17,0x12,0x09,0xfe,0xa4,0xec,0x13,0x92,0x49,0xee,0xff,0x23,0x71,0xf3,0x89,0x40,0x92,0x86,0xc4,0x2b,0x59,0x55,0x85,0x63,0x96,0xb7,0x94};
    static std::uint8_t c52[32] = {0x5d,0x31,0xf1,0xf3,0x85,0x0b,0x28,0x0e,0x5f,0xeb,0x6a,0xbe,0xf3,0x70,0x4c,0xb1,0x4c,0x9c,0x13,0xaf,0xaf,0x2d,0xe7,0x8b,0xb5,0x1d,0xc9,0x30,0x34,0x24,0x0d,0xbb};
    sm2_fn_from_bytes(a, a52);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c52, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a53[32] = {0x07,0x02,0x46,0x8e,0x8c,0xbd,0x6c,0x55,0x37,0x28,0x34,0xf7,0x38,0x72,0x07,0x8b,0x36,0x1d,0x05,0x62,0xcb,0x90,0x4f,0xf7,0x63,0x71,0xa0,0x3f,0xbe,0xa0,0xff,0x70};
    static std::uint8_t c53[32] = {0xcc,0x9e,0x20,0x51,0x33,0xc9,0x64,0x2e,0x37,0x53,0x53,0xa4,0x1a,0x46,0x2e,0x94,0x74,0x30,0x4a,0x01,0xee,0x58,0xe0,0x10,0x86,0xf9,0x0f,0x59,0x1f,0x76,0xa2,0xd4};
    sm2_fn_from_bytes(a, a53);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c53, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a54[32] = {0x5a,0x58,0xec,0xb9,0x7d,0x41,0xef,0x14,0xc3,0x05,0x5f,0x4d,0x01,0xf1,0x37,0xee,0xa1,0xa4,0x37,0x2f,0xd8,0x50,0x64,0x6f,0xa9,0xb3,0xd9,0x02,0x0e,0xce,0x32,0xce};
    static std::uint8_t c54[32] = {0x63,0xb6,0x4f,0x5a,0x9d,0x87,0xb8,0xdf,0x23,0xe8,0xe5,0xfe,0x24,0x47,0xe0,0x8e,0xa8,0x83,0x6c,0xaa,0x27,0xef,0xd5,0x35,0x30,0x3a,0xb3,0x77,0x6f,0x07,0xe8,0x4c};
    sm2_fn_from_bytes(a, a54);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c54, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a55[32] = {0x5c,0x2c,0x3b,0x6a,0x13,0x54,0x78,0xa2,0xe8,0x33,0xc5,0x81,0xb1,0x8f,0x79,0xcc,0x4b,0xd4,0x85,0xb0,0x8d,0x63,0x93,0x06,0x9a,0x3a,0x0e,0x71,0xa5,0xcf,0x92,0x9b};
    static std::uint8_t c55[32] = {0x69,0xe5,0x85,0x50,0x6f,0x45,0xc2,0x82,0xfd,0x70,0x07,0x81,0x9b,0xa4,0x19,0x99,0x0b,0xc6,0x5b,0x84,0xc4,0x38,0xb1,0xd8,0xb0,0x4e,0x3a,0xd2,0x00,0x9a,0x95,0x42};
    sm2_fn_from_bytes(a, a55);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c55, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a56[32] = {0x1a,0x0d,0x82,0xaa,0x56,0x13,0x1f,0x02,0xb3,0x8c,0xcc,0xa0,0xdf,0xbd,0x74,0x7a,0xf3,0x09,0x42,0xc9,0xcf,0x25,0xc2,0x51,0xb8,0xc0,0x8f,0x18,0x6c,0x0f,0xd6,0xf6};
    static std::uint8_t c56[32] = {0xe8,0xdf,0xb0,0x47,0xb9,0xb0,0xc7,0xd1,0x76,0xbb,0x0a,0xfc,0xdb,0x0c,0xd5,0xb2,0x59,0xff,0x39,0xc7,0x94,0x9b,0xdf,0xf7,0xed,0xea,0xbd,0x8f,0x17,0x61,0xac,0xaf};
    sm2_fn_from_bytes(a, a56);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c56, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a57[32] = {0xd2,0x05,0xda,0xfb,0x21,0xab,0x88,0x37,0x66,0xbf,0x41,0x90,0x13,0x1b,0x30,0xc2,0x41,0xd0,0xfe,0x7f,0xc2,0x18,0x24,0xa8,0xbb,0x37,0x2e,0xa5,0xca,0x14,0x55,0x46};
    static std::uint8_t c57[32] = {0x0a,0x3e,0xfe,0x89,0x3f,0xda,0x81,0x44,0xec,0x24,0xf4,0x23,0x69,0x8c,0x45,0xc9,0x0b,0xae,0x50,0x11,0x31,0xdd,0xdf,0x57,0x11,0xa5,0xae,0xa6,0x57,0xea,0x23,0x08};
    sm2_fn_from_bytes(a, a57);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c57, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a58[32] = {0x7f,0xbc,0x43,0x67,0x20,0x53,0x81,0x85,0x50,0x01,0xe1,0x78,0x20,0x76,0xb5,0xcd,0x3e,0x99,0x46,0x56,0x8f,0x1a,0xaf,0xfa,0x8a,0xfe,0xda,0x9b,0x11,0x1d,0x76,0xb0};
    static std::uint8_t c58[32] = {0x77,0x32,0x61,0x17,0xa2,0xeb,0x6f,0xd7,0x3c,0x16,0xbf,0xe2,0xfe,0xd3,0x09,0x9f,0x6f,0x53,0x01,0x7c,0x8a,0x4e,0x9a,0x47,0x3d,0x25,0x87,0xd4,0x1b,0x1e,0x1d,0x61};
    sm2_fn_from_bytes(a, a58);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c58, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a59[32] = {0x2b,0x6d,0x1c,0xac,0xd3,0xd9,0xf2,0xde,0x8e,0xf2,0xf6,0x86,0x3b,0x38,0x86,0x46,0x99,0x33,0x09,0xd8,0x4c,0x7d,0x8b,0x28,0xcd,0x75,0x32,0xc6,0x8a,0xee,0x1b,0x50};
    static std::uint8_t c59[32] = {0x72,0x1f,0x88,0x00,0xe1,0x49,0x8e,0x3c,0xc9,0x6c,0xc4,0x07,0x7d,0x66,0xe0,0xa9,0x2a,0xc4,0x6d,0x3f,0x5b,0x4a,0x77,0xa9,0xab,0x6d,0x9d,0x29,0x29,0xef,0x44,0xc1};
    sm2_fn_from_bytes(a, a59);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c59, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a60[32] = {0xdc,0x00,0x43,0x98,0x53,0xbf,0x60,0x62,0x4b,0xc7,0x90,0x46,0x39,0xe8,0xb0,0xcd,0xe9,0xe9,0x81,0xfe,0x12,0xb3,0xf0,0x20,0x31,0xc9,0xb4,0x2f,0x4b,0x93,0xdf,0x3d};
    static std::uint8_t c60[32] = {0x76,0x0a,0xe3,0xd7,0xd0,0xf9,0x07,0x56,0x37,0xc4,0xcc,0x5d,0xd8,0xea,0xdd,0x65,0x9f,0x37,0xfc,0xf2,0xb4,0x98,0x73,0x2e,0xb4,0xa4,0xce,0x5f,0xd3,0x52,0xa2,0x07};
    sm2_fn_from_bytes(a, a60);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c60, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a61[32] = {0x60,0x4b,0xb4,0xd6,0x0f,0x95,0xec,0x07,0x29,0x53,0x31,0x80,0xa5,0xc6,0x2f,0xa1,0xb0,0x53,0xc7,0x35,0x47,0x03,0x5f,0x82,0x16,0xf1,0x2b,0x0c,0xa0,0x10,0x6d,0x25};
    static std::uint8_t c61[32] = {0x1f,0xef,0x2c,0x2c,0xf4,0x9a,0xfa,0xb5,0xf6,0xa0,0x3e,0x50,0xc9,0x64,0xb8,0x0e,0x42,0x15,0x89,0xf6,0x64,0x94,0x2e,0xc8,0x08,0xba,0x78,0x4b,0x6f,0x64,0xfd,0xdf};
    sm2_fn_from_bytes(a, a61);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c61, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a62[32] = {0x62,0xe4,0x14,0xb9,0x75,0x67,0x38,0x13,0x5b,0x0c,0x2c,0x8b,0x05,0x2b,0xb2,0x76,0xa0,0x57,0x46,0xc4,0x41,0x47,0x2a,0x49,0x74,0xf7,0xcb,0xe7,0x3f,0xa0,0xf1,0x7a};
    static std::uint8_t c62[32] = {0x9e,0x2e,0xf4,0xbe,0xa7,0x5b,0x48,0x10,0xb6,0x41,0xab,0xe3,0x85,0x05,0x9e,0x65,0xb2,0x0c,0x60,0x29,0x38,0xff,0xfc,0xf0,0xdf,0xad,0xaf,0xc4,0xa3,0xab,0x3e,0x34};
    sm2_fn_from_bytes(a, a62);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c62, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a63[32] = {0x34,0x60,0x9f,0x8d,0xdf,0x44,0x58,0x8b,0xbf,0xad,0xb0,0x0a,0x29,0xcf,0x6d,0x7f,0x74,0xf4,0xfa,0x77,0xe0,0xc5,0x52,0x51,0x7a,0x88,0x4f,0x7b,0xfb,0xab,0x41,0xde};
    static std::uint8_t c63[32] = {0x19,0x67,0x30,0x01,0x36,0xbb,0xcd,0x22,0xc6,0x20,0x5c,0x29,0xbe,0x4b,0x1c,0x17,0x1f,0xbf,0xf9,0xfc,0x3c,0x90,0x2a,0x4e,0x31,0x58,0xea,0x30,0xea,0xaf,0x1d,0xc3};
    sm2_fn_from_bytes(a, a63);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c63, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a64[32] = {0xbc,0xa0,0x74,0x63,0x52,0x00,0xee,0xd8,0x9c,0x8e,0x03,0x7a,0x1f,0x6a,0xa0,0x0e,0x7b,0x2c,0x01,0x3c,0x0c,0xbb,0xff,0x6c,0x8e,0xd7,0x03,0x18,0xe1,0xba,0x13,0x6e};
    static std::uint8_t c64[32] = {0x56,0x92,0xb9,0xf2,0xf7,0x05,0x3b,0xe3,0x33,0x1c,0xa9,0x33,0x01,0x35,0x0f,0x48,0x68,0xc2,0x43,0xac,0xa7,0x1d,0x37,0x35,0x56,0x12,0xd3,0x28,0x19,0xd5,0xbc,0x66};
    sm2_fn_from_bytes(a, a64);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c64, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a65[32] = {0xde,0x76,0xff,0xad,0x7c,0x56,0x7e,0xbd,0x22,0xe2,0x23,0x95,0x86,0xe4,0x61,0xae,0x0d,0xc3,0x73,0xe8,0x46,0xc3,0xa4,0x56,0xf0,0x0c,0xd8,0xd2,0xb7,0xac,0xfd,0x15};
    static std::uint8_t c65[32] = {0xa8,0xf8,0x8c,0x6b,0x67,0x0d,0x70,0x5b,0xbb,0xe9,0xb7,0x02,0xe4,0x26,0x1c,0xeb,0x7e,0x08,0x2c,0xa8,0x65,0x65,0xd6,0xd1,0xa5,0x98,0xfc,0xe7,0x5d,0x92,0x78,0x84};
    sm2_fn_from_bytes(a, a65);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c65, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a66[32] = {0x6b,0x07,0x3e,0x11,0x34,0x08,0x6a,0x94,0xba,0x5b,0xe1,0x0f,0xe9,0x9b,0xf4,0xb5,0x4c,0x3b,0x28,0x0b,0x69,0x1b,0xfb,0x10,0x59,0xaa,0x11,0xe0,0xd6,0x6b,0x15,0xed};
    static std::uint8_t c66[32] = {0x44,0x66,0xb3,0x1b,0xd7,0x00,0xa9,0x87,0x24,0xe0,0xc0,0xe0,0x77,0x96,0x17,0xb1,0x8d,0x0f,0x80,0x56,0x36,0xc0,0x85,0x68,0xaf,0xec,0x21,0x81,0x49,0x5e,0x36,0x1b};
    sm2_fn_from_bytes(a, a66);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c66, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a67[32] = {0xb9,0x16,0xba,0x2f,0xd1,0x7c,0x88,0xb1,0xb1,0xc3,0xcc,0x49,0x65,0x68,0xda,0xa1,0x63,0x0f,0x44,0x42,0xeb,0x7c,0x8f,0x2f,0x53,0x62,0xc3,0x35,0x4c,0x18,0xe2,0x33};
    static std::uint8_t c67[32] = {0x2b,0xc7,0x44,0x99,0x16,0x47,0xd0,0x2e,0x53,0xb6,0xc2,0x9f,0x19,0xb9,0x75,0x4d,0xb0,0x61,0x6f,0x3e,0x1c,0x81,0x3f,0x35,0xa6,0xfe,0x12,0xb3,0xca,0x33,0x14,0xe3};
    sm2_fn_from_bytes(a, a67);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c67, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a68[32] = {0x6b,0x2a,0x63,0xc9,0xb8,0xab,0xc7,0x06,0x8c,0xfa,0x93,0x20,0xd2,0x74,0x20,0x6d,0xd9,0xb7,0x9a,0xdd,0xaa,0x3f,0xe7,0x8d,0x40,0x30,0x22,0x09,0x98,0x63,0xbe,0xf6};
    static std::uint8_t c68[32] = {0x12,0xa1,0x09,0x61,0x7c,0x7b,0x82,0x5f,0x96,0x30,0x6b,0xd0,0x4b,0xaa,0xae,0x55,0x87,0xe7,0xf1,0xd5,0xeb,0x12,0x27,0xa2,0x1c,0x62,0x5d,0x5d,0xb9,0x91,0x44,0x69};
    sm2_fn_from_bytes(a, a68);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c68, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a69[32] = {0xb5,0x5d,0xba,0xb4,0x4f,0xad,0x05,0xba,0x5e,0x0e,0xdd,0x8b,0xef,0xa7,0xb8,0x9f,0x8c,0x74,0x02,0x1c,0x53,0x4c,0x98,0x9b,0xd7,0xe3,0x9b,0x3a,0xba,0xbf,0x13,0x86};
    static std::uint8_t c69[32] = {0x31,0x12,0x4d,0xcc,0x67,0x8c,0x87,0x24,0x36,0x90,0x3f,0xf0,0xb6,0xfd,0xae,0x6e,0x8c,0x1c,0x81,0xb0,0x09,0xa9,0x7b,0xd6,0xb3,0xaf,0xe8,0xb7,0x80,0xe0,0x55,0x25};
    sm2_fn_from_bytes(a, a69);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c69, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a70[32] = {0x1d,0x3a,0xca,0x62,0xcb,0xa9,0xc8,0x41,0xd8,0xca,0xf7,0x9e,0x2d,0xa1,0xfa,0xdc,0x4e,0x3c,0xe1,0x8e,0x4a,0x9a,0x2a,0x25,0x8d,0xac,0xeb,0x7f,0x00,0xb6,0x51,0x0e};
    static std::uint8_t c70[32] = {0xe0,0x1f,0x9f,0xe1,0x7a,0x99,0xed,0x89,0xe1,0xa2,0xc5,0xa7,0x08,0xcb,0x6b,0x1f,0xb7,0x23,0x58,0x9b,0x16,0x80,0xaa,0xb7,0xfa,0x3e,0x82,0xda,0x2a,0x27,0xcc,0x04};
    sm2_fn_from_bytes(a, a70);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c70, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a71[32] = {0xc1,0x29,0x4f,0x4a,0x1a,0x41,0x78,0x65,0xa5,0x5f,0x8e,0x86,0x65,0xe1,0xb0,0x17,0xb9,0x77,0x39,0x4a,0x20,0xfe,0x17,0xbc,0x14,0x97,0x9a,0x03,0xf0,0x46,0x85,0x0a};
    static std::uint8_t c71[32] = {0xba,0x64,0x1f,0x20,0xe0,0xf3,0xae,0x32,0x2d,0xcd,0xd1,0x5c,0xe2,0x2a,0xda,0x39,0x15,0xcc,0x69,0x3f,0xd0,0x1a,0x2c,0xf8,0xd9,0x7d,0xbd,0xe3,0xe7,0x9d,0xad,0x5b};
    sm2_fn_from_bytes(a, a71);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c71, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a72[32] = {0xbd,0xe3,0xd3,0xae,0x28,0xfc,0x4e,0x04,0xd8,0x48,0x78,0xbf,0x23,0x28,0x41,0xd7,0x33,0xe3,0x41,0x39,0x5f,0xf7,0x23,0x96,0x2c,0xe5,0xd6,0x69,0x24,0xdb,0x75,0xe3};
    static std::uint8_t c72[32] = {0xca,0x8a,0x7b,0xe2,0x51,0xee,0x87,0xf4,0x5b,0x7a,0x52,0xcd,0xa8,0x00,0x35,0xbd,0xc0,0x6c,0x9e,0xee,0xcc,0xa2,0xef,0x30,0x1b,0x30,0xcd,0x22,0xc0,0x55,0xf7,0xda};
    sm2_fn_from_bytes(a, a72);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c72, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a73[32] = {0x8f,0xd7,0xf8,0x6d,0xa7,0x71,0xdd,0xd5,0x0a,0xc7,0x41,0x31,0x34,0x3a,0x9b,0x9f,0xf5,0x4f,0xca,0xe8,0x09,0x76,0xb8,0xc9,0x10,0xfe,0x42,0xcf,0x4a,0x89,0x94,0xc9};
    static std::uint8_t c73[32] = {0xcb,0xca,0x24,0x42,0x79,0xcd,0xc1,0xcf,0x4d,0xf3,0xce,0xd9,0xd4,0xa4,0x8d,0x57,0xee,0x66,0xb5,0xb8,0x7e,0x4a,0x23,0x7d,0x53,0x2b,0x4e,0x13,0x60,0x48,0x5b,0x7b};
    sm2_fn_from_bytes(a, a73);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c73, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a74[32] = {0x75,0x5a,0x60,0x2b,0x15,0xa8,0xab,0x3a,0xd9,0xda,0x44,0xf9,0xe9,0xe2,0xa4,0x9e,0x95,0x2b,0x8b,0x9a,0xf7,0xb1,0xaf,0x25,0x5a,0x4d,0x6f,0xe5,0x7a,0x9f,0x94,0xb9};
    static std::uint8_t c74[32] = {0xb2,0x3c,0x94,0x32,0x01,0xcc,0x4d,0xca,0x0e,0x8d,0x7d,0xa5,0xb9,0x3a,0xd9,0x6a,0xe5,0x24,0xfb,0x43,0x9c,0xd7,0x36,0xa6,0x16,0xbe,0xcd,0x22,0x8f,0x9a,0x5c,0x66};
    sm2_fn_from_bytes(a, a74);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c74, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a75[32] = {0x1f,0xa4,0xba,0xd9,0x1d,0x1c,0x1b,0x94,0x7f,0x44,0xa5,0x4f,0x68,0x73,0x04,0xa8,0x85,0xad,0x5a,0x7f,0xae,0x2b,0xaf,0xa5,0xa2,0xe5,0xeb,0x78,0x39,0x29,0x73,0x7b};
    static std::uint8_t c75[32] = {0xbc,0xc4,0xcf,0x35,0x54,0x8e,0x07,0xe7,0xac,0xea,0x51,0x07,0x22,0x97,0x52,0x8e,0x76,0xb5,0xb1,0xf0,0x84,0x10,0xe2,0x46,0xe2,0x6a,0x25,0xf4,0x61,0x1d,0xc1,0x5e};
    sm2_fn_from_bytes(a, a75);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c75, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a76[32] = {0x59,0x4c,0xad,0xe6,0x39,0x2d,0x61,0xb3,0xfb,0xe2,0xe6,0xf6,0xec,0xcb,0xe7,0xfd,0x1f,0xcf,0xe6,0xbe,0x1f,0x18,0xfd,0xfa,0xb6,0x50,0x25,0x19,0xe0,0x10,0xc5,0x89};
    static std::uint8_t c76[32] = {0xc1,0xfa,0x2e,0x04,0xab,0xe0,0x5d,0x8f,0xc6,0x84,0xca,0xc2,0xca,0x97,0x0d,0x02,0xfd,0x1f,0x44,0xab,0x45,0x0f,0xc9,0xf9,0x67,0x9e,0x8d,0x86,0x49,0xb8,0xfd,0x2b};
    sm2_fn_from_bytes(a, a76);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c76, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a77[32] = {0xd7,0xf9,0x8b,0xc5,0xbf,0x61,0x4e,0x1d,0xdd,0x03,0x8e,0x1b,0x1b,0xe5,0xb8,0x78,0x8a,0x49,0x81,0x27,0xd3,0x8d,0xdb,0x2f,0x37,0x6d,0xe2,0x6f,0x8a,0x32,0xd8,0xef};
    static std::uint8_t c77[32] = {0x95,0x57,0xf3,0x47,0xf0,0x4d,0x14,0xf3,0x42,0xd4,0xf1,0x27,0x69,0x59,0x19,0x98,0xd6,0xf3,0x70,0x35,0x4f,0x2b,0x8c,0x13,0x49,0x5f,0x6f,0x17,0xc0,0xc5,0xfb,0x0f};
    sm2_fn_from_bytes(a, a77);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c77, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a78[32] = {0x6f,0x1d,0x62,0x1d,0x55,0x77,0x70,0x96,0x22,0x02,0xba,0x3e,0x24,0xe6,0x6c,0x55,0xcf,0x1c,0x58,0x33,0xde,0x5d,0xcc,0x6c,0xcd,0x89,0xf3,0x7e,0x0e,0xb6,0x97,0xe0};
    static std::uint8_t c78[32] = {0x0b,0xa6,0x10,0xcf,0xbd,0xa8,0x31,0x36,0x34,0xd8,0xf4,0xee,0xdc,0x32,0xa6,0x00,0x24,0xea,0x8f,0xa5,0x2f,0x4b,0xe6,0xa1,0xca,0x8a,0x99,0x6a,0xe4,0xad,0xfb,0xdf};
    sm2_fn_from_bytes(a, a78);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c78, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a79[32] = {0x64,0x8f,0x5d,0x58,0x66,0xe8,0x22,0xa1,0x12,0xad,0x36,0x6f,0x39,0x16,0xdc,0xe2,0xed,0x5b,0x50,0x65,0xa6,0xd3,0xe7,0x51,0x3c,0x1a,0x55,0x04,0xb8,0x07,0x26,0xb9};
    static std::uint8_t c79[32] = {0x03,0xa6,0x65,0x6d,0xc4,0x05,0x34,0xa2,0xe3,0x08,0x30,0xe7,0x49,0x2a,0xda,0xf9,0x83,0x68,0x5f,0x01,0x7e,0x68,0xd8,0xbf,0x50,0xf6,0xab,0xf7,0xaf,0x2b,0xf7,0xff};
    sm2_fn_from_bytes(a, a79);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c79, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a80[32] = {0x50,0x57,0x81,0x3f,0x7a,0x18,0x4f,0xd0,0x11,0xf8,0xb1,0xb5,0xd3,0x94,0xff,0x24,0x90,0xdd,0x10,0xe1,0xef,0x6a,0xb8,0x47,0x1d,0x1f,0x17,0xa4,0xfb,0x10,0xa5,0xf5};
    static std::uint8_t c80[32] = {0xd4,0xe2,0x39,0x40,0xc8,0xe5,0xc7,0x82,0x27,0x25,0xa0,0x00,0x6d,0x47,0x86,0xea,0xd0,0x18,0x79,0xbb,0xbf,0x30,0xd5,0x99,0x91,0xbf,0x4a,0x19,0x5c,0x0d,0xbb,0xae};
    sm2_fn_from_bytes(a, a80);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c80, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a81[32] = {0x5c,0x41,0xa3,0xed,0xa4,0x66,0x53,0x96,0x69,0x27,0x4a,0x3c,0x4b,0x86,0x85,0x05,0xbf,0xf8,0x1b,0x87,0x11,0x52,0xde,0x0c,0x30,0xf6,0xd6,0x30,0x6d,0x42,0x41,0xad};
    static std::uint8_t c81[32] = {0xc7,0xb4,0x7f,0x7e,0x85,0x34,0x90,0xa2,0x50,0x64,0x6e,0xc3,0x72,0x50,0xd5,0x39,0x12,0xcd,0x9f,0x9a,0x79,0x1d,0xe3,0x7a,0xea,0xda,0xc4,0x39,0x77,0xbc,0xfd,0xdc};
    sm2_fn_from_bytes(a, a81);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c81, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a82[32] = {0x88,0x38,0xda,0x71,0x23,0xaa,0x34,0x99,0x6e,0xcb,0xe1,0xc6,0x9a,0xb1,0x6e,0xa2,0x62,0x8e,0x8a,0xc7,0xd5,0x9a,0x0d,0x18,0x2a,0xad,0xaa,0x3a,0xf8,0xc2,0x45,0xfc};
    static std::uint8_t c82[32] = {0xdb,0x4c,0x18,0x0c,0xfc,0xba,0x6d,0xde,0x6e,0xed,0x50,0x79,0x6d,0xfc,0x37,0xa8,0xa8,0xc0,0x75,0x79,0xfa,0x9c,0x95,0x51,0x02,0x71,0x91,0x40,0xf9,0x7d,0xae,0x61};
    sm2_fn_from_bytes(a, a82);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c82, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a83[32] = {0x01,0x80,0xdf,0x87,0x3c,0x2d,0x1d,0x45,0x70,0xbd,0xcd,0x41,0x97,0x78,0x9a,0x79,0xb7,0x43,0x9a,0xd5,0x19,0xcf,0x83,0xfd,0x0b,0xef,0xc9,0xd1,0xb5,0x0a,0xe2,0x7e};
    static std::uint8_t c83[32] = {0xf5,0xfb,0xad,0x27,0x87,0x39,0x58,0x0d,0x83,0xec,0x97,0x60,0xac,0x0c,0x90,0x98,0xde,0xbd,0xfa,0x5f,0xf1,0x3e,0x59,0xfc,0x5f,0x62,0x62,0xbd,0xac,0x1e,0x8e,0x4a};
    sm2_fn_from_bytes(a, a83);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c83, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a84[32] = {0x74,0xfa,0x49,0x43,0x75,0xed,0x07,0x86,0xdf,0xa8,0x35,0x37,0x59,0x5d,0x12,0x9f,0x57,0x71,0x68,0xb9,0x4a,0x68,0xea,0xc3,0x11,0x4e,0xd2,0x75,0x62,0xfc,0x51,0x33};
    static std::uint8_t c84[32] = {0x66,0x12,0x99,0x99,0xc4,0xff,0xf6,0xa3,0x09,0x12,0x05,0x9a,0x50,0x41,0x45,0xfb,0x72,0xcb,0x94,0xd7,0xed,0x4a,0xcd,0xbc,0x17,0x76,0x8e,0xaa,0x31,0xb2,0xc2,0x7e};
    sm2_fn_from_bytes(a, a84);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c84, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a85[32] = {0x9c,0x63,0x2f,0x02,0x57,0x5b,0xc0,0x26,0x91,0xcf,0x98,0x9d,0x99,0x5e,0x7a,0x52,0x76,0x2d,0x1b,0x26,0x35,0x65,0xdb,0x2c,0x77,0x02,0x5f,0xa2,0x70,0x3b,0x82,0x0e};
    static std::uint8_t c85[32] = {0x53,0x31,0x25,0x37,0x5d,0x60,0x01,0xbf,0x3a,0x72,0x28,0x48,0x88,0xd2,0xe4,0x8e,0xa6,0xe8,0xea,0x50,0xf3,0xa2,0x86,0x7e,0x98,0x80,0x50,0x7d,0xb6,0x1b,0x38,0xe5};
    sm2_fn_from_bytes(a, a85);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c85, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a86[32] = {0x95,0x21,0x37,0x6c,0xc6,0x9a,0x13,0xdd,0xb7,0xa3,0x67,0xad,0x65,0x67,0x0f,0xb8,0xbe,0x24,0xeb,0x19,0x0b,0x94,0x57,0x2a,0x93,0xaf,0x49,0x10,0x33,0xfa,0x6b,0x1a};
    static std::uint8_t c86[32] = {0x47,0x17,0x27,0x9e,0x04,0x61,0xe0,0x01,0xfb,0x4d,0x38,0xd3,0x9d,0x54,0xf1,0x49,0xeb,0x8c,0x3e,0xbe,0xa2,0xdd,0x52,0x0f,0xd2,0xce,0xc9,0x8a,0x09,0x92,0x8b,0xcb};
    sm2_fn_from_bytes(a, a86);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c86, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a87[32] = {0x35,0xf8,0xb3,0x54,0x26,0x0a,0x0a,0x92,0x0d,0x8d,0x23,0x53,0x57,0x75,0xed,0xef,0xa3,0x95,0x12,0xa0,0xce,0x05,0x5d,0xfe,0x89,0xf5,0x78,0x45,0x6f,0x51,0x31,0x06};
    static std::uint8_t c87[32] = {0x29,0x26,0x2c,0x35,0x0a,0x58,0x72,0x38,0xaa,0xab,0x7a,0x85,0xb9,0x11,0x61,0x50,0xc3,0x47,0x27,0x33,0x4c,0x87,0xad,0xb8,0x9d,0x33,0x0b,0xa2,0xa4,0x23,0x33,0xf9};
    sm2_fn_from_bytes(a, a87);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c87, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a88[32] = {0x71,0xed,0xc2,0x7f,0x6d,0xa2,0x33,0xbe,0x4e,0x06,0x1d,0xb5,0x06,0xa1,0x9a,0xd3,0x38,0x7a,0xc2,0x0b,0xb0,0xfa,0xc7,0xb2,0x69,0xc2,0xe1,0xaa,0xa2,0x4b,0x17,0x56};
    static std::uint8_t c88[32] = {0xd1,0x32,0x1c,0x60,0x4d,0x6f,0xbc,0xf6,0xc8,0x9b,0xf9,0x44,0x38,0x82,0x60,0x6c,0x60,0x78,0xc2,0x7e,0x0d,0x15,0x9c,0xee,0x32,0xee,0x22,0x4b,0x92,0x0a,0x9b,0x64};
    sm2_fn_from_bytes(a, a88);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c88, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a89[32] = {0x70,0x87,0xf1,0x24,0x62,0x86,0x4d,0xcb,0xa2,0xbc,0xf2,0x0f,0x78,0x76,0x33,0xb6,0xb3,0x57,0x20,0x7d,0xf4,0xc3,0x83,0x76,0xae,0x2f,0x45,0x9d,0x5a,0xe6,0x81,0xb7};
    static std::uint8_t c89[32] = {0x5a,0x52,0x00,0x52,0x62,0x23,0x54,0x1a,0x57,0x8f,0x84,0x9b,0x78,0x2e,0x6d,0x45,0xb1,0x69,0x93,0xb3,0xf3,0xc2,0xb6,0x1c,0x9d,0xdc,0x6b,0xb6,0xdc,0x97,0x71,0x14};
    sm2_fn_from_bytes(a, a89);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c89, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a90[32] = {0xea,0x7b,0xc6,0x33,0x20,0xba,0x91,0xf6,0xf7,0x2d,0x5e,0x5b,0x5b,0xb7,0xcf,0x9a,0x61,0x93,0x64,0x7c,0x27,0xbc,0x58,0x91,0x80,0xb9,0x0d,0x1f,0xdf,0x00,0x26,0xda};
    static std::uint8_t c90[32] = {0x66,0x01,0x0e,0x0b,0xac,0xd5,0xd6,0x21,0xe4,0xd0,0x05,0x7f,0xe8,0xc9,0x42,0xdb,0x6b,0x54,0x28,0x58,0x88,0x52,0xe2,0xde,0x83,0xa0,0x5c,0xcf,0xa9,0xe6,0xfd,0x3e};
    sm2_fn_from_bytes(a, a90);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c90, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a91[32] = {0xa1,0x80,0xb0,0xff,0xc8,0x1d,0x70,0x64,0x6b,0x12,0x85,0xad,0xae,0xc9,0x08,0x6d,0xf9,0x4b,0x4a,0x13,0x9d,0x33,0x90,0xce,0x24,0x3d,0x0a,0x93,0xe4,0x96,0x93,0x66};
    static std::uint8_t c91[32] = {0x23,0x8d,0x78,0x10,0x5c,0x4c,0xcb,0x9a,0xbc,0xed,0xba,0xec,0x45,0xa7,0x1c,0x03,0x65,0x88,0xe0,0x31,0xa7,0x8f,0xe4,0xb9,0xeb,0xfc,0x28,0xaa,0x3a,0xd8,0x9e,0xb5};
    sm2_fn_from_bytes(a, a91);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c91, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a92[32] = {0x58,0x53,0x7b,0xd3,0x91,0x7b,0xd9,0x6c,0x45,0x7f,0xc4,0x76,0x6f,0x2e,0x32,0x6f,0x96,0x8f,0x75,0x99,0x62,0x3e,0x03,0x69,0x11,0x64,0xc4,0x7d,0xd9,0x38,0x8c,0xcb};
    static std::uint8_t c92[32] = {0xf7,0xe5,0x1d,0xf3,0x02,0xe3,0xce,0x91,0x5a,0xfd,0x82,0xe3,0x18,0x98,0x0d,0x95,0xbb,0x18,0x76,0x86,0xb4,0xdf,0x8a,0x15,0x8b,0x48,0x67,0x42,0x0d,0x5b,0xc0,0x8b};
    sm2_fn_from_bytes(a, a92);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c92, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a93[32] = {0x22,0x71,0xa7,0x3b,0x4a,0x83,0x0c,0xce,0xe3,0x73,0x14,0x0b,0x01,0x34,0x6f,0xa5,0x35,0xbc,0xeb,0x63,0x48,0xc0,0x3b,0x76,0xac,0x0d,0x43,0x05,0x63,0x72,0x54,0x4f};
    static std::uint8_t c93[32] = {0x62,0x3a,0xe0,0x2c,0x23,0xc9,0x56,0x1b,0x16,0x67,0x9c,0x9b,0xb9,0xed,0x73,0x49,0xa8,0x62,0xd7,0xa7,0xa6,0x78,0x4d,0xca,0xfe,0xcf,0xf2,0x3f,0x50,0x2c,0xda,0xfe};
    sm2_fn_from_bytes(a, a93);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c93, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a94[32] = {0x66,0x02,0x8e,0x92,0x84,0x4a,0xd1,0x6f,0xae,0x16,0xc3,0x1d,0xe2,0xfb,0xf2,0x22,0x2a,0x8c,0xc8,0x62,0x17,0x4e,0x07,0x4a,0xf4,0xb7,0xda,0x3b,0x3c,0xff,0x0e,0x6f};
    static std::uint8_t c94[32] = {0x70,0x9a,0x02,0x3f,0xf5,0x25,0x49,0xd6,0x8d,0x82,0x37,0xcd,0xa9,0x6b,0xad,0x58,0xf3,0x7b,0x99,0xbc,0x9c,0xe4,0x99,0x1a,0x23,0x81,0x42,0xf4,0xc2,0xc5,0x21,0x93};
    sm2_fn_from_bytes(a, a94);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c94, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a95[32] = {0x80,0xf1,0x02,0x77,0xfc,0x58,0xa6,0x5b,0xcc,0x2d,0x03,0x7c,0xb0,0xff,0x92,0x59,0x3c,0xba,0x88,0x5b,0xd0,0xca,0x7b,0xc7,0x69,0xb2,0xfc,0xa4,0xb6,0x04,0xbe,0xfd};
    static std::uint8_t c95[32] = {0x65,0x20,0xc4,0x71,0x9a,0xe8,0xf9,0xcd,0xa1,0x23,0xfb,0x4c,0xd4,0x21,0x5c,0x10,0xa5,0x8b,0xdc,0x7b,0xa6,0xe7,0x27,0x05,0xad,0x3f,0x6d,0x55,0x8c,0x9a,0x35,0x7b};
    sm2_fn_from_bytes(a, a95);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c95, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a96[32] = {0x64,0xc0,0x00,0x93,0x4b,0xea,0xa7,0xe6,0x58,0x3f,0x1c,0xa3,0x82,0x0b,0x29,0xa9,0x24,0x4e,0x3b,0x14,0x3a,0x53,0x41,0x85,0xc5,0xe1,0x16,0x53,0x61,0x9a,0x9a,0xe4};
    static std::uint8_t c96[32] = {0xe3,0x49,0x96,0xf6,0x1f,0xe6,0x1b,0x91,0xbe,0xf0,0x27,0x0f,0xb0,0x1a,0x6f,0x62,0x30,0xc4,0x3f,0xca,0xf7,0x9b,0x5c,0xfc,0xda,0x09,0xc9,0xcd,0x92,0xe4,0x37,0xea};
    sm2_fn_from_bytes(a, a96);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c96, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a97[32] = {0xeb,0x76,0x39,0xcd,0x49,0x74,0x25,0x21,0x4b,0xd2,0x90,0xd0,0x01,0x3d,0x96,0x95,0x89,0xc1,0xaa,0x60,0x7c,0xdb,0x67,0x83,0xab,0x2e,0xf1,0xff,0xd9,0x7f,0xcf,0x0f};
    static std::uint8_t c97[32] = {0xf8,0x77,0x59,0x81,0xd4,0xde,0x50,0xa2,0x9b,0xd3,0x0a,0xdb,0x6e,0xd1,0x99,0x23,0x4e,0xca,0x40,0xf3,0x1b,0xc6,0x94,0xfc,0x0e,0x12,0x9e,0x81,0x0e,0xbc,0xaa,0x93};
    sm2_fn_from_bytes(a, a97);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c97, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a98[32] = {0x33,0xea,0x76,0x42,0x70,0x06,0xff,0x80,0x05,0x58,0xb6,0x47,0xb3,0x9e,0xf5,0x24,0xdc,0xce,0x57,0xe7,0xa8,0xf6,0x26,0x70,0xcb,0x47,0xd1,0xbc,0xd2,0xe8,0x1a,0xb3};
    static std::uint8_t c98[32] = {0x7e,0xff,0x96,0xf6,0x93,0x04,0x35,0x07,0x58,0x30,0xa9,0x46,0x0d,0xaa,0x59,0xa0,0x69,0x91,0x5e,0x68,0x0d,0xb6,0x2c,0x37,0x74,0xb1,0x5f,0x39,0x8b,0x0b,0x15,0xcc};
    sm2_fn_from_bytes(a, a98);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c98, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }

    static std::uint8_t a99[32] = {0x7c,0x2e,0x41,0xd6,0x9d,0x8f,0xc9,0x5b,0x5a,0x86,0x5a,0x38,0x2c,0x50,0x3f,0xf4,0x98,0x2b,0xe7,0x1e,0x63,0x75,0x4b,0xc2,0x6c,0xaf,0x99,0x53,0x80,0xf8,0x7b,0xbc};
    static std::uint8_t c99[32] = {0x97,0x5c,0x01,0xa9,0xe8,0x02,0xc8,0x5f,0x19,0xf6,0xec,0x5e,0x35,0x57,0x39,0xa1,0xd5,0x4e,0xa5,0xa5,0x3c,0xf8,0x39,0x98,0x13,0xbe,0xd8,0xbd,0x3b,0x35,0x53,0x8b};
    sm2_fn_from_bytes(a, a99);
    sm2_fn_sqr(c, a);
    sm2_fn_to_bytes(c_data, c);
    if (std::memcmp(c99, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm2_fn_sqr");
    }
}